package com.example.idea.customer;

import com.example.idea.IdeaApplication;
import org.springframework.web.bind.annotation.*;

import java.util.List;
@RequestMapping(path = "api/v1/customer")
@RestController
@Deprecated
public class CustomerController {
    private final CustomerService customerService;

    public CustomerController(CustomerService customerService) {
       this.customerService=customerService;
    }

    @GetMapping(value ="all")
    List<Customer> getCustomers() {
        return customerService.getCustomers();
    }

@PostMapping
 void creatNewCustomer(@RequestBody Customer customer) {
    System.out.println("POST 请求。。。");
    System.out.println(customer);
}
@DeleteMapping(path = "{customerId}")
    void deleteCustomer(@PathVariable("customerId")Long id){
    System.out.println("Delete 请求，删除 Customer，其id为"+id);
}
@PutMapping
    void updateCustomer(@RequestBody Customer customer){
    System.out.println("UPDATE 请求");
    System.out.println(customer);
}



}
